import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("add_charge_order", { schema: "cabinet" })
export class AddChargeOrder {
  @PrimaryGeneratedColumn({ type: "int", name: "order_id", unsigned: true })
  orderId: number;

  @Column("int", {
    name: "relation_order_id",
    unsigned: true,
    default: () => "'0'",
  })
  relationOrderId: number;

  @Column("int", {
    name: "user_id",
    comment: "用户id",
    unsigned: true,
    default: () => "'0'",
  })
  userId: number;

  @Column("decimal", {
    name: "charge_amount",
    comment: "充电金额",
    precision: 5,
    scale: 2,
    default: () => "'0.00'",
  })
  chargeAmount: string;

  @Column("decimal", {
    name: "fee_amount",
    comment: "扣金额的",
    precision: 5,
    scale: 2,
    default: () => "'0.00'",
  })
  feeAmount: string;

  @Column("decimal", {
    name: "fee_reward_amount",
    comment: "扣奖励的",
    precision: 5,
    scale: 2,
    default: () => "'0.00'",
  })
  feeRewardAmount: string;

  @Column("tinyint", {
    name: "status",
    comment: "0:等待开始充电,1:充电中,2:失败",
    unsigned: true,
    default: () => "'0'",
  })
  status: number;

  @Column("tinyint", {
    name: "error_code",
    unsigned: true,
    default: () => "'0'",
  })
  errorCode: number;

  @Column("int", {
    name: "create_time",
    comment: "创建时间",
    unsigned: true,
    default: () => "'0'",
  })
  createTime: number;
}
